package com.jadeen.enums;

import lombok.Getter;

/**
 * 分类类型枚举
 * 
 * @author: ChickenWing
 * @date: 2023/10/3
 */
@Getter
public enum StatusEnum {

    ON("1","开启"),
    OFF("0","关闭");

    public String code;

    public String desc;

    StatusEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static StatusEnum getByCode(String codeVal){
        for(StatusEnum resultCodeEnum : StatusEnum.values()){
            if(resultCodeEnum.code.equals(codeVal)){
                return resultCodeEnum;
            }
        }
        return null;
    }

}
